package com.xw.echo.core;

import lombok.Data;
@Data
public class RpcContext {
    private static ThreadLocal<Object> threadLocalResult = new ThreadLocal<>();

    // 设置 ThreadLocal 变量
    public static void setResult(Object result) {
        threadLocalResult.set(result);
    }

    // 获取 ThreadLocal 变量
    public static Object getResult() {
        return threadLocalResult.get();
    }

    // 清除 ThreadLocal 变量，避免内存泄漏
    public static void clearResult() {
        threadLocalResult.remove();
    }

}
